<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller;

class BaseController extends Controller
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;


    public function successResponse($data= [], $message = '操作成功')
    {
        return response()->json([
            'message' => $message,
            'data' => $data,
            'code' => 200
        ], 200);
    }
    public function failResponse($message = '服务器异常')
    {
        return response()->json([
            'message' => $message,
            'code' => 500
        ], 200);
    }

}
